# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-google-auth
pkgver=2.16.2
pkgrel=2
pkgdesc="Google Authentication Library"
url="https://github.com/GoogleCloudPlatform/google-auth-library-python"
license=('Apache')
arch=('any')
depends=('python-cachetools' 'python-certifi' 'python-pyasn1-modules' 'python-rsa')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-mock' 'python-requests' 'python-flask'
              'python-oauth2client' 'python-pytest-localserver' 'python-cryptography'
              'python-freezegun' 'python-responses' 'python-pyopenssl' 'python-pyu2f')
source=("https://github.com/GoogleCloudPlatform/google-auth-library-python/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('c5263f54b524a64f53815697f3b83adcbea1192b3ddbb49129cee62a4d71bcdd59405a4cb1bc727953804a598cfddb2f14a102d543d0b415dd4b7ffd28e89a1e')

prepare() {
  cd google-auth-library-python-$pkgver
  sed -i 's/from requests.packages.urllib3.util.ssl_ import/from urllib3.util.ssl_ import/' google/auth/transport/requests.py
}

build() {
  cd google-auth-library-python-$pkgver
  python setup.py build
}

check() {
  cd google-auth-library-python-$pkgver
  python -m pytest tests
}

package() {
  cd google-auth-library-python-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
